from gmpy2 import *
import binascii

n = 6266565720726907265997241358331585417095726146341989755538017122981360742813498401533594757088796536341941659691259323065631249
e1 = 773
e2 = 839
c1=3453520592723443935451151545245025864232388871721682326408915024349804062041976702364728660682912396903968193981131553111537349
c2=5672818026816293344070119332536629619457163570036305296869053532293105379690793386019065754465292867769521736414170803238309535
s = gcdext(e1, e2)

s1, s2 = s[1], s[2]
if s1 < 0:
    s1 = -s1
    c1 = invert(c1, n)
elif s2 < 0:
    s2 = -s2
    c2 = invert(c2, n)

m1 = powmod(c1, s1, n)
m2 = powmod(c2, s2, n)
m = (m1*m2)%n
# 1021089710312311910410111011910111610410511010710511610511511211111511510598108101125
# flag = binascii.unhexlify(hex(m)[2:]).decode('utf-8')
tmp = str(m)
i = 0
flag = ''
while i < len(tmp):
    if tmp[i] == '1':
        flag += chr(int(tmp[i:i+3]))
        i += 3
    else:
        flag += chr(int(tmp[i:i+2]))
        i += 2

print(flag) # flag{whenwethinkitispossible}